<template>
	<view class="w-100">
		<view class="portfolio-box mx-3 mt-2 flex-1">
			<view class="portfolio-item p-1" v-for="(item,index) in portfolioList" :key="index">
				<view class="portfolio-img">
					<image :src="item.main_image" mode=""></image>
				</view>
				<view class="mt-2 flex-1 mx-2">
					<view class="flex-1">
						<view class="font-s-45">组合套餐</view>
						<view class="font-s-45 font-w mt-2">{{ item.portfolio_name }}</view>
						<view class="row-ac mt-2">
							<view class="font-s-45">套餐价:<text class="ml-2">¥{{ item.price }}</text></view>
							<!-- <view class="text-light-grey text-de ml-3">原 价:<text class="ml-2">¥{{ item.mar_price }}</text></view> -->
						</view>
						<view class="mt-2 font-s-45">升级:<text class="ml-2">{{ item.identity_name }}</text></view>
						<view class="flex-1 mt-3 row-ac justify-end pb-3 ">
							<view class="detail-box font-s-3" @click="toDetail(item.id)">套餐详情</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		productportfolioListUrl
	} from "@/api/promotion.js"
	export default {
		data() {
			return {
				queryInfo: {
					page: 1,
					page_size: 10
				},
				portfolioList: []
			}
		},
		onLoad() {
			this.getPortfolioList()
		},
		methods: {
			getPortfolioList() {
				this.$R.get(productportfolioListUrl, this.queryInfo).then(res => {
					console.log('9999', res.code);
					if (res.code == 200) {
						this.portfolioList = res.data.list
						this.portfolioTotal = res.data.total
					}
				})
			},
			toDetail(portfolioId){
				uni.navigateTo({
					url: '/pages/promotion/portfolio-detail?portfolioId=' + portfolioId
				});
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.portfolio-item{
		background-color: #fff;
		margin-bottom: 30rpx;
		.portfolio-img{
			width: 670rpx;
			height: 460rpx;
		}
	}
	.portfolio-scroll{
		width: 670rpx;
		height: 320rpx;
	}
	.detail-box{
		padding: 13rpx 22rpx;
		background-color: #000;
		color: #fff;
	}
</style>